Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore]: use ErrorContains and EqualError #11295

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Sep 28, 2024

Description

Testifylint doesn't support it yet.
This replaces Contains(t, err.Error() by ErrorContains(t, err and Equal(t, err.Error() by EqualError(t, err
As they both check for nil error it becomes useless to check it yourself without having defined a custom message

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.47%. Comparing base (d128618) to head (ba8344d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11295   +/-   ##
=======================================
  Coverage   91.47%   91.47%           
=======================================
  Files         424      424           
  Lines       20219    20219           
=======================================
  Hits        18495    18495           
  Misses       1341     1341           
  Partials      383      383           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35 mmorel-35 marked this pull request as ready for review September 28, 2024 10:47
@mmorel-35 mmorel-35 requested a review from a team as a code owner September 28, 2024 10:47
@bogdandrutu bogdandrutu merged commit aba139c into open-telemetry:main Sep 28, 2024
54 of 64 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 28, 2024
@mmorel-35 mmorel-35 deleted the testify/error-contains branch September 28, 2024 15:14
jackgopack4 pushed a commit to jackgopack4/opentelemetry-collector that referenced this pull request Oct 8, 2024
#### Description

Testifylint doesn't support it yet. 
This replaces `Contains(t, err.Error()` by `ErrorContains(t, err` and
`Equal(t, err.Error()` by `EqualError(t, err`
As they both check for nil error it becomes useless to check it yourself
without having defined a custom message

<!-- Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> -->

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants